//  On my honor:
//	
//  - I have not used source code obtained from another student, 
//    or any other unauthorized source, either modified or unmodified.  
//	
//  - All source code and documentation used in my program 
//    is either my original work, or was derived by me from the source
//    code published in the textbook for this course.
//	
//  - I have not discussed coding details about this project with anyone
//    other than my instructor, ACM/UPE tutors or the GTAs assigned to this
//    course. I understand that I may discuss the concepts of this program
//    with other students, and that another student may help me debug my
//    program so long as neither of us writes anything during the discussion
//    or modifies any computer file during the discussion.  I have violated
//    neither the spirit nor letter of this restriction.
//	

/**
 * @author Christopher Suh, Eric Yoo
 * 
 */
public class ListNode {
	private ListNode prevNode, nextNode;
	private int index = 0, size = 0;

	ListNode(int index_in, int size_in) {
		index = index_in;
		size = size_in;
		prevNode = null;
		nextNode = null;
	}

	/**
	 * Returns the previous node of the current node.
	 * 
	 * @return previous node
	 */
	public ListNode getPrev() {
		return this.prevNode;
	}

	/**
	 * Sets the previous node as the given node.
	 * 
	 * @param prev_in
	 *            new previous node.
	 */
	public void setPrev(ListNode prev_in) {
		this.prevNode = prev_in;
	}

	/**
	 * Returns the next node of the current node.
	 * 
	 * @return next node
	 */
	public ListNode getNext() {
		return this.nextNode;
	}

	/**
	 * Sets the next node of as the given node.
	 * 
	 * @param next_in
	 *            new next node.
	 */
	public void setNext(ListNode next_in) {
		this.nextNode = next_in;
	}

	/**
	 * Accessor for the size variable.
	 * 
	 * @return the size.
	 */
	public int getSize() {
		return this.size;
	}

	/**
	 * Accessor for the index variable.
	 * 
	 * @return the index.
	 */
	public int getIndex() {
		return this.index;
	}
}
